<?php /*@var $tree Tree */?>
<?php if( !empty($arTree)): ?>
<?php $curent = TreePeer::retrieveByPK($sf_params->get('id'));
$curentBranch = false;
if($curent)
    $curentBranch = $curent->getBranch(); ?>
<?php foreach( $arTree as $tree ): ?>
    <?php $true = ''; ?>
    <?php if( $tree['obj']->getStatusId() == MyConstants::STATUS_APPROVED ): ?>
        <?php if( preg_match("/\b" . (int)$tree['obj']->getId() . "\b/", $curentBranch) || ($sf_params->get('id')== $tree['obj']->getId()) ){$true = '_selected';} ?>
        <?php switch ($tree['obj']->getLabel()):
            case "ABOUTUS":  ?>
                <h2 class="apiemus<?php echo $true;?>">
            <?php break; 
            case "SERVICES": ?>
                <h2 class="paslaugos<?php echo $true;?>">
            <?php break; 
            case "DONEJOBS": ?>
                <h2 class="atliktidarbai<?php echo $true;?>">
            <?php break; 
            case "PROJECTS": ?>
                <h2 class="musuprojektai<?php echo $true;?>">
            <?php break; 
            case "FRIENDS": ?>
                <h2 class="musudraugai<?php echo $true;?>">
            <?php break; 
            case "CONTACTS": ?>
                <h2 class="kontaktai<?php echo $true;?>">
            <?php break; ?>  
            <?php default: ?>
                <h2 class="default<?php echo $true;?>">
            <?php break; ?>
        <?php endswitch; ?>
        <?php echo link_to(image_tag('blank.gif'
                                    , array('style' => 'background: none; border: 0px;'
                                            , 'border' => 0
                                            , 'alt' => $tree['obj']->getName())) 
                        , 'tree/page?id=' . $tree['obj']->getId()
                        , array('style' => 'float: left;'));?>
        </h2>
    <?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>